package com.mz.mattress.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mz.mattress.api.entity.Advert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AdvertMapper extends BaseMapper<Advert> {

    @Select("select * from mz_advert where type=#{type} and status=1 and deleted=0")
    List<Advert> selectByType(@Param("type") Integer type);

    Page<Advert> listPage(Page page,
                          @Param("type") Integer type,
                          @Param("status") Integer status);

}
